package cn.itcast.bos.utils;

import java.util.Collection;
import javax.ws.rs.core.MediaType;
import org.apache.cxf.jaxrs.client.WebClient;

import cn.itcast.bos.domain.page.PageBean;
import cn.itcast.bos.domain.take_delivery.Promotion;
import cn.itcast.crm.domain.Customer;


public class RS_Client {
	public static void main(String[] args) {
		// type 传参 --- @Consumes
		// accept 返回 ---- @Produces
		//注册
//		Customer c = new Customer();
//		c.setUsername("新用户");
//		c.setTelephone("15877779999");
//		c.setPassword("123456");
//		WebClient.create("http://localhost:9002/crm_management/services/customerService/customer").type(MediaType.APPLICATION_JSON).post(c);
	
		//根据手机号查找用户
//		Customer c2 = WebClient
//				.create("http://localhost:9002/crm_management/services/customerService/customer/telephone/15877779999")
//				.accept(MediaType.APPLICATION_JSON).get(Customer.class);
//		System.out.println(c2);
		
		//绑定邮箱，其实就是把c_type字段设置成1
//		WebClient.create("http://localhost:9002/crm_management/services/customerService/customer/updatetype/15877779999").put(null);
		
		//登录
//		Customer c3 = WebClient.create("http://localhost:9002/crm_management/services/customerService/customer/login?telephone=15868447541&password=123456").get(Customer.class);
//		System.out.println(c3);
		
//		PageBean<Promotion> pageBean  = WebClient.create("http://localhost:9001/bos_management/services/promotionService/pageQuery?page=1&rows=10").get(PageBean.class);
//		System.out.println(pageBean);
		
//		Promotion p = WebClient.create("http://localhost:9001/bos_management/services/promotionService/promotion/109").get(Promotion.class);
//		System.out.println(p);
	}
}
